var t = getApp(), e = require("../../../api.js");

Component({
    properties: {},
    data: {
        authorize: ""
    },
    lifetimes: {
        attached: function() {
            this.getData();
        }
    },
    methods: {
        showToast: function() {
            this.triggerEvent("showToast", {
                showToast: !0
            });
        },
        hideToast: function() {
            this.triggerEvent("hideToast", {
                showToast: !1
            });
        },
        getData: function() {
            var o = this;
            t.request({
                url: e.driver.getDriverQrcode,
                method: "post",
                success: function(t) {
                    wx.setStorageSync('authorize', t.data.img)
                    0 == t.code && (wx.showToast({
                        title: t.msg,
                        icon: "none"
                    }), setTimeout(function() {
                        wx.navigateBack({});
                    }, 800)), o.setData({
                        authorize: t.data.img,
                        user: t.data
                    });
                }
            });
        }
    }
});